var cateSel;
$(document).ready(function() {
	$('select[name="fieldId"]').change(function(){
		if ($(this).val() != "0") {
			$.blockUI({ message: ajaxAnimation });
			$.ajax({
			  url: 'searchCatByFieldId.html',
			  data : {'fieldId' : $(this).val()},
			  dataType : 'json',
			  success: function(data) {
					$("#cateId").get(0).options.length = 0;
					$("#cateId").get(0).options[0] = new Option("L\u1EF1a ch\u1ECDn", "-1");
					cateSel = $('select[name="cateId"]').html();				  
				  	var catHtml = cateSel;
					$.each(data.catList, function() {
						catHtml += '<option value="' + this.value + '">' + this.name + '</option>';
					});			 
					$('select[name="cateId"]').html(catHtml);										
			  }
			});
		}
	});




/*	new Calendar({
	    inputField: "fromDate",
	    dateFormat: "%d/%m/%Y",
	    trigger: "fromDateCal",
	    titleFormat: "%b %Y",
	    bottomBar: false,
	    onSelect: function() { this.hide(); }
	});

	new Calendar({
	    inputField: "toDate",
	    dateFormat: "%d/%m/%Y",
	    trigger: "toDateCal",
	    bottomBar: false,
	    onSelect: function() { this.hide(); }
	});
	*/
});